﻿<%@ Page Title="" Language="C#" MasterPageFile="~/YiDashuihang_.Master" AutoEventWireup="true" CodeBehind="Staff_add.aspx.cs" Inherits="YiDaShuiHang.Staff_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Styles/Staff.css" rel="stylesheet" />
    <script src="Scripts/page_js/Staff.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            check_logion("manager_name", "login.html");
        })

        function add_manager() {
            var username=$.cookie("manager_name"); 
            if (username == "yidashuihang") {
                var username = $("#account").val();
                var new_pwd = $("#password").val();
                if (isUndefinedNullOrEmpty(username) || isUndefinedNullOrEmpty(new_pwd)) {
                    alert("用户名或密码不能为空");
                }
                else {
                    poststr = "{\"type\":\"addmanager\",\"username\":\"" + username + "\",\"password\":\"" + $.md5(new_pwd) + "\"}";
                    mj_js_ajax("json", poststr, change_atate);
                }
            }
            else {
                layer_alert_error("只有管理员才能添加送水人员！");
                
            }


        }
        function change_atate(data) {
            if (data.result == "ok") {
                alert(data.msg);
            }

        }

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
        <div class="content" style=" width:98%; height:auto; margin:0 auto; ">
        <div class="header">
            <h1 class="page-title">
                添加员工</h1>
        </div>
        <div class="main-content">
            <div class="row">
                <div class="col-md-4">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab">
                            <div class="form-group">
                                <label for="account">
                                    新员工账号</label><input type="text" class="form-control" id="account" placeholder="账号为1-16位"></div>
                            <div class="form-group">
                                <label for="password">
                                    密码</label><input type="password" class="form-control" id="password" placeholder="输入密码"></div>
                            </form>
                        </div>
                    </div>
                    <div class="btn-toolbar list-toolbar">
                        <input onclick="add_manager()"  value="添加" type="button" class="btn btn-info" id="add" style=" margin-top:20px; width:99%"/>
                           </div>
                    <div id="common_msg" class="text-info">
                    </div>
                </div>
            </div>
            <footer><hr><p>© 2015 <a href="#">shuihang</a></p></footer>
        </div>
    </div></div>
</asp:Content>
